package com.jrx.mservices.feign.service;

import com.jrx.mservices.feign.model.ServiceInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 消费服务类
 *
 * @author zwg
 * @create 2018-03-06 17:32
 */
//FeignClient注解来绑定该接口对应provide-eureka服务
@FeignClient("provide-eureka")
public interface FeignService {


    /**
     * 对于provide-eureka提供的具体服务
     * @return
     */
    @RequestMapping(value = "/provide/test", method = RequestMethod.GET)
    String provideTestFunc();

    /**
     * 按接口定义的返回值类型接收
     * @return
     */
    @RequestMapping(value = "/provide/testObj", method = RequestMethod.GET)
    List<ServiceInfo> provideTestObjFunc();

    /**
     * 使用字符串类型接收
     * @return
     */
    @RequestMapping(value = "/provide/testObj", method = RequestMethod.GET)
    String provideTestObjFuncStr();

}
